package com.lcx.boot;

import com.lcx.client.IUserService;
import com.lcx.client.RPCConsumer;
import com.lcx.request.RpcRequest;

public class ConsumerBoot {

    //参数定义
    private static final String PROVIDER_NAME="UserService#sayHello#";//参数定义

    public static void main(String[] args) throws InterruptedException {
        RpcRequest rpcRequest = new RpcRequest();
        //1.创建代理对象
        IUserService userService = (IUserService) RPCConsumer.createProxy(IUserService.class, rpcRequest);
        //2.循环给服务器写数据
        while (true){
            String result = userService.sayHello("are you ok??");
            System.out.println(result);
            Thread.sleep(2000);
        }
    }
}
